<?php

use app\components\BaseGridView;
use app\models\User;

?>

<?= BaseGridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        //['class' => 'yii\grid\SerialColumn'],
        //['class' => 'yii\grid\CheckboxColumn', 'headerOptions' => ['width' => '5%']],
        'id',
        ['attribute' => 'uname', 'label' => '姓名'],
        'phone',
        ['label' => '学校', 'value' => function (User $model) {
            return $model->profile->school;
        }],
        ['label' => '邮箱', 'value' => function (User $model) {
            return $model->profile->email;
        }],
        ['label' => '微信', 'value' => function (User $model) {
            return $model->profile->wechat;
        }],
//        ['label' => '状态', 'format' => 'raw', 'value' => function (User $model) {
//            return $model->_statusLabel();
//        }],
        'ctime:datetime',
        [
            'class' => 'app\components\BaseActionColumn',
            'template' => '{view}',
            'viewOptions' => ['title' => '查看用户信息', 'data-width' => 650],
        ],
    ],
]); ?>
